package com.igeek.d0613;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 * @Author: zhiyu
 * @Date:17:56
 * @DESC:
 */
public class Test3 {
    public static void main(String[] args) {
        String[] arr = {"A","B","C"};
        List<String> list = Arrays.asList(arr);
        ScheduledExecutorService pool = Executors.newScheduledThreadPool(1);
        for (int i = 1; i <= 10; i++) {
            pool.submit(()->{
                System.out.print(list.get(0));
            });
            pool.submit(()->{
                System.out.print(list.get(1));
            });
            pool.submit(()->{
                System.out.print(list.get(2));
                System.out.println();
            });
        }
        pool.shutdown();
    }
}
